package com.pengshun.modules.api.mapper;

import com.pengshun.modules.api.order.service.dto.OrderAllotTransportDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author luoligang
 * @create 2021/2/24
 */
public interface OrderAllotTransportMapper {

    /**
     * 查询分配过的 待确认 已确认 已发布的总数量
     * @param orderId
     * @return
     */
    @Select("SELECT  SUM(allot_number) FROM  ps_order_allot_transport  WHERE order_id=#{orderId} and  `status` BETWEEN 1 AND 3")
    BigDecimal findAllotCoalSumNum(@Param("orderId") Long orderId);

    /**
     * 商户分配货运列表查询
     * @param orderId
     * @param status
     * @return
     */
    List<OrderAllotTransportDto> findListByOrderIdAndStatus(@Param("orderId") Long orderId, @Param("status") Integer status);
}
